Fix duplicate validations and overly broad interface matching in title validation #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses code review feedback on PR #20 to eliminate redundant validations and tighten interface matching logic.
Changes
Interface matching precision: Changed
"title" in interface.lower()tointerface_lower == "title"to prevent false matches on "subtitle", "entitle", etc.Excerpt validation loop: Break after first successful reference field match to avoid N validations when multiple reference fields contain values
Title validation loop: Validate only first available title against first available reference instead of all combinations (prevents N×M duplications)
Class documentation: Updated
ReferenceValidationPlugindocstring to reflect title validation capabilities and dcterms:title field discoveryTest coverage: Added
test_validate_title_only_fetch_fails()for whenfetcher.fetch()returns NoneExample
Before: Instance with 2 title fields and 2 reference fields → 4 validation calls
After: Instance with 2 title fields and 2 reference fields → 1 validation call (first title × first reference)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.